Skip to content

Introduce Product Resource - #39

Open
imRohan wants to merge 8 commits into
mainfrom
rl-introduce-products
Open

Introduce Product Resource#39
imRohan wants to merge 8 commits into
mainfrom
rl-introduce-products

Conversation

@imRohan

@imRohan imRohan commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Version 2 of the api is now available, and introduces the Product resource. We'd like to expose this via the gem, allowing our clients to consume this new resource. The Product resource will be retrieved via ID using a different api, version 2. This new API utilizes a basic authentication scheme. Since this is the first resource to be consumed via the v2 API this PR not only introduces Products, it also adds all the plumbing required to interact with the new api version.

This change addresses the need by:

  • Introducing a v2 authenticator
  • Introducing a v2 api
  • Introducing a Product resource and a CoreObject

@imRohan imRohan self-assigned this May 8, 2026
@imRohan
imRohan force-pushed the rl-introduce-products branch from b8686e4 to e4434cf Compare May 8, 2026 18:54
@imRohan

imRohan commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Testing, working on staging (Auth + Retrieve Product)
image

@imRohan
imRohan force-pushed the rl-introduce-products branch 2 times, most recently from 83e0c90 to c99e65f Compare May 13, 2026 15:40
@imRohan
imRohan requested review from chriswoodford and jmazur May 13, 2026 18:06
@chriswoodford

Copy link
Copy Markdown
Contributor

the authentication changes need to be their own PR...

@imRohan

imRohan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

This needs to be refactored after this PR is merged: #41

@imRohan
imRohan force-pushed the rl-introduce-products branch 2 times, most recently from ac7eff9 to 8b4e783 Compare August 10, 2026 18:13
@imRohan
imRohan requested a review from jmazur August 10, 2026 19:42
@imRohan
imRohan force-pushed the rl-introduce-products branch 3 times, most recently from f5022c0 to 8db3d7c Compare August 12, 2026 14:31
Version 2 of the api is now available, and introduces the Product
resource. We'd like to expose this via the gem, allowing our clients to
consume this new resource. The Product resource will be retrieved via ID
using a different api, version 2. This new API utilizes a basic
authentication scheme. Since this is the first resource to be consumed
via the v2 API this PR not only introduces Products, it also adds all
the plumbing required to interact with the new api version.

This change addresses the need by:
* Introducing a v2 authenticator
* Introducing a v2 api
* Introducing a CoreObject resource which can be used by all core (v2)
  objects
* Introducing a Product resource
@imRohan
imRohan force-pushed the rl-introduce-products branch from dd091b3 to 2ba0d70 Compare August 18, 2026 15:06
Comment on lines +17 to +21
as_packaged = NutritionFact.
build_from_array(data[:nutrition_facts][:as_packaged])
as_cooked = NutritionFact.
build_from_array(data[:nutrition_facts].
fetch(:as_cooked, []))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess as packaged always exists and as cooked only exists sometimes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly that. as_cooked is optionally returned, so using fetch to guard against that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants